package com.wavecoler.professor.dao;

import com.google.appengine.api.datastore.Key;

import javax.jdo.PersistenceManager;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.wavecoler.professor.objects.AdviceCategory;
import com.wavecoler.dao.PMF;

@PersistenceCapable
public class AdviceCategoryDAO {
	
	// Insertar, Modificar y Eliminar
	
	public void saveAdviceCategory(String adviceCategoryNum, String categoryName, String Preference) {
		PersistenceManager pm = PMF.get().getPersistenceManager();
		AdviceCategory adviceCategory = new AdviceCategory(adviceCategoryNum, categoryName, Preference);
		
		try {
            pm.makePersistent(adviceCategory);
        } finally {
            pm.close();
        }
	}
}
